<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
  <!--css样式引入-->
  <head th:replace="admin/common::head-fragment"></head>

<body>
  <!--左边工具栏-->
  <nav th:replace="admin/common::navbar-fragment(active='category.html')"></nav>

    <div class="page">

      <!--顶部导航栏-->
      <header th:replace="admin/common::topbar-fragment"></header>

      <!-- Breadcrumb-->

      <section>
        <div class="container-fluid">
          <!-- Page Header-->
          <div class="card-header">
            <h3 class="card-title">分类管理</h3>
          </div>
          <div>
            <div >
              <div class="card">
                <div class="card-body">
                  <div class="grid-btn">
                    <button class="btn btn-info" onclick="addCategory()"><i
                            class="fa fa-plus"></i>&nbsp;新增
                    </button>
                    <button class="btn btn-info" onclick="updateCategory()"><i
                            class="fa fa-pencil-square-o"></i>&nbsp;修改
                    </button>
                    <button class="btn btn-danger" onclick="deleteCategory()"><i
                            class="fa fa-trash-o"></i>&nbsp;删除
                    </button>
                  </div>
                  <br>
                  <div class="table-responsive">
                    <table class="table table-striped table-hover" style="table-layout:fixed;">
                      <thead>
                        <tr>
                          <th><input type="checkbox" id="checkController"/></th>
                          <th>分类名称</th>
                          <th>该分类下博客数</th>
                          <th>创建时间</th>
                        </tr>
                      </thead>
                      <tbody>
                        <tr th:each="blogCategory:${blogCategories}">
                          <th scope="row"><input type="checkbox" name="checkOption" /></th>
                          <td th:text="${blogCategory.getId()}" name="id" style="display:none;" ></td>
                          <td th:text="${blogCategory.getName()}" name="name" style="word-wrap:break-word;"></td>
                          <td th:text="${blogCategory.getCount()}"></td>
                          <td th:text="${blogCategory.getCreateTime()}"></td>
                        </tr>
                      </tbody>
                    </table>
                  </div>
                </div>
              </div>
            </div>
          </div>
        </div>
      </section>
      <!--底部-->
      <footer th:replace="admin/common::footer-fragment"></footer>

    </div>
    <!--javascript-->
    <div th:replace="admin/common::JavaScript-fragment"></div>
    <script th:src="@{/admin/js/category.js}"></script>
    <script th:src="@{/vendor/sweetalert/sweetalert.min.js}"></script>
    <!-- image-picker -->
    <script th:src="@{/vendor/image-picker/jquery.masonry.min.js}"></script>
    <script th:src="@{/vendor/image-picker/image-picker.min.js}"></script>

  </body>
</html>